{% extends "forum/base.html" %}
{# open user page #}

{% block head %}
<script type="text/javascript">
    {% include "forum/forum.js" %}
    
    window.addEvent('domready',
            function(){
                /* the link to the current page must be highlighted */
                var section_label = $('{{act}}');
                if(section_label)
                    section_label.addClass("mark"); 

                $('friend_button').addEvent('click', function(e){
                    add_friend( '{% url forum_friend_act forum_user.username,"add"%}' );
                });
                
                clear_sucess();
            });
</script>
{% endblock head %}

{% block body %}
{% with forum_user.forum_profile as forum_profile %}

<div class="shared_profile">
    <div id="ajax_messaging" class="clear"></div>
    <div class="span-6" style="text-align: center;">        
        <div class="clear">
            <strong>{{ forum_user.username }}</strong>
        </div>
        
        <img alt="User Avatar Image" class="user_avatar"
            src="{{forum_profile.get_avatar_url}}"></img>
        <span class="clearfix"><strong>{{ forum_profile.title }}</strong></span>
        <span class="clearfix">Total Topics : {{ forum_profile.topic_count }}</span>
        <span class="clearfix">Total Posts : {{ forum_profile.post_count }}</span>
        <span class="clearfix">User Since : {{ forum_user.date_joined|date}}</span>
        <div style="padding: 5px 0px;">
            <a id="friend_button" class="fake-button" title="Add as New Friend">+ Friend</a>
            <a id="pvt_button" class="fake-button" href='{% url forum_user forum_user.username,"pvt" %}' title="Send a private message to this user">PVT</a>
        </div>
    </div>

    <div class="span-18 last">
        <div class="digg-bar">
            <a id="stats" href="{% url forum_user forum_user.username,"stats" %}"><strong>Stats</strong></a>
            <a id="friends" href="{% url forum_user forum_user.username,"friends" %}"><strong>Friends</strong></a>
            {% if owner %}
            <a id="messages" href="{% url forum_user forum_user.username,"messages" %}"><strong>Messages</strong></a>
            <a id="profile" href="{% url forum_user forum_user.username,"profile" %}"><strong>Personal Data</strong></a>
            {% endif %}
        </div>
        <div class="clear" style="padding-top: 5px;">
        {% include show_page %}
        </div>
    </div>
</div>

{% endwith %}
{% endblock body %}